package com.echoplots.exception.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.echoplots.exception.exception.DemoNotExistException;

@RestController
@RequestMapping(value="demo")
public class LearnController {
    @GetMapping("/{id:\\d+}")
    public void get(@PathVariable String id) {
        throw new RuntimeException("demo not exist");
    }
    
    
    
    @GetMapping("exception/{id:\\d+}")
    public void getException(@PathVariable String id) {
        throw new DemoNotExistException(id);
    }
}